const path = require('path');
const compressing = require('compressing');

module.exports = function (folderName) {

    const source = path.resolve(__dirname, `../packages/${folderName}/`);
    const destination = path.resolve(__dirname, `../dist/${folderName}.zip`);

    compressing.zip.compressDir(source, destination)
        .then(() => {
            console.log('压缩完成。');
        })
        .catch(err => {
            console.error('压缩失败：', err);
        });
}